package com.lagou.homework2.no3;

/**
 * 上网套餐类 特征：上网流量、每月资费 行为：显示所有套餐信息
 */
public class InternetPackage  extends TalkAndInternet implements InternetServiceInterface{
    //上网流量
    private int internetTraffic;
    //无参构造器
    public InternetPackage() {
    }

    //有参构造器
    public InternetPackage(int internetTraffic, String monthlyCharges) {
        super(monthlyCharges);
        this.internetTraffic = internetTraffic;
    }

    public int getInternetTraffic() {
        return internetTraffic;
    }

    public void setInternetTraffic(int internetTraffic) {
        this.internetTraffic = internetTraffic;
    }

    //行为
    public void show(int internet,String monthly){
        System.out.println("上网流量："+internet+",每月资费："+monthly);

    }

    @Override
    public void method2(int internetTraffic, IcCards icCards) {
        setInternetTraffic(internetTraffic);
        setMonthlyCharges("卡号："+icCards.getCardNum()+",上网流量："+icCards.getInternetTraffic()+",通话时长："+icCards.getTalkTime()+"。");
        show(this.internetTraffic,super.getMonthlyCharges());
    }
}
